package com.wen.service;

import com.wen.pojo.Role;
import com.wen.pojo.Users;
import org.springframework.security.core.userdetails.UserDetailsService;

import java.util.List;

public interface UserService extends UserDetailsService {
    /**
     * 查询全部
     *
     * @return
     * @throws Exception
     */
    List<Users> findAll(int page, int size) throws Exception;

    /**
     * 添加用户
     *
     * @param users
     * @return
     * @throws Exception
     */
    int add(Users users) throws Exception;

    Users findById(int id) throws Exception;

    int deleteById(int id) throws Exception;

    int updateById(Users users) throws Exception;

    List<Role> findOtherRoles(int userId) throws Exception;

    void addRoleToUser(int userId, int[] roleIds);
}
